package myapp.baselibrary.ioc;

import android.app.Activity;
import android.view.View;

/**
 * Created by yang2 on 2017/6/8.
 */
//View辅助类
public class ViewFinder {

    private View mView;

    private Activity mActivity;

    public ViewFinder(View view) {
        this.mView = view;
    }

    public ViewFinder(Activity activity) {
        this.mActivity = activity;
    }
    public ViewFinder(){}

    public void setActivity(Activity mActivity) {
        this.mActivity = mActivity;
    }

    public void setView(View mView) {
        this.mView = mView;
    }

    public View findById(int viewId){
        return mActivity!=null?mActivity.findViewById(viewId):mView.findViewById(viewId);
    }

}
